<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>后台--文章管理</title>
    <link rel="stylesheet" type="text/css" href="<?php echo isset($skin)?$skin:"";?>images/style.css" />
    <base target="_self"/>

    <script src='<?php echo isset($skin)?$skin:"";?>js/jquery.min.js'></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/jquery.form.min.js"></script>
    <script type="text/javascript" src="<?php echo isset($skin)?$skin:"";?>js/dist/dialog-min.js"></script>
    <script src="<?php echo isset($skin)?$skin:"";?>js/admin.js"></script>
    <script type="text/javascript">
        <!--
        $(document).ready(function () {
            $('.new_table tbody tr:even').addClass('h'); //奇偶变色，添加样式
        });
        //-->
    </script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>/js/validate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artTemplate-plugin.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/form.js"></script>
    <script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/artDialog.js"></script>
<script type="text/javascript" charset="UTF-8" src="<?php echo isset($skin)?$skin:"";?>js/iframeTools.js"></script>
<link rel="stylesheet" href="<?php echo isset($skin)?$skin:"";?>js/artdialog.css" type="text/css">
</head>
<body>
<div class="hh6"></div>
<script language="javascript">
    //获得选中文件的数据表
    function getCheckboxItem() {
        var myform = document.form1;
        var allSel = "";
        if (myform.bakfile.value)
            return myform.bakfile.value;
        for (i = 0; i < myform.bakfile.length; i++)
        {
            if (myform.bakfile[i].checked) {
                if (allSel == "")
                    allSel = myform.bakfile[i].value;
                else
                    allSel = allSel + "," + myform.bakfile[i].value;
            }
        }
        return allSel;
    }
    //反选
    function ReSel() {
        var myform = document.form1;
        for (i = 0; i < myform.bakfile.length; i++) {
            if (myform.bakfile[i].checked)
                myform.bakfile[i].checked = false;
            else
                myform.bakfile[i].checked = true;
        }
    }
    //全选
    function SelAll() {
        var myform = document.form1;
        for (i = 0; i < myform.bakfile.length; i++) {
            myform.bakfile[i].checked = true;
        }
    }
    //取消
    function NoneSel() {
        var myform = document.form1;
        for (i = 0; i < myform.bakfile.length; i++) {
            myform.bakfile[i].checked = false;
        }
    }
    //
    function checkSubmit()
    {
        var myform = document.form1;
        myform.bakfiles.value = getCheckboxItem();
        return true;
    }

</script>
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="new_table">
    <thead>
    <tr class="n_bt"><td colspan="8" align="center">管理系统</td></tr>
    <tr><th class="thbt" colspan="8">【<?php echo isset($title)?$title:"";?>】 <a href="?c=backup">数据备份</a></th></tr>
    </thead>
    <form name="form1" onSubmit="checkSubmit()" action="?c=backup&a=reduction_do" method="post" target="stafrm">
        <input type='hidden' name='dopost' value='redat' />
        <input type='hidden' name='bakfiles' value='' />
        <input type='hidden' name='folder' value='<?php echo isset($folder)?$folder:"";?>' />
        <tr bgcolor="#F7F8ED">
            <td height="24" colspan="4" valign="top">
                <strong>发现的备份文件：</strong>
                <?php if(count($filelists)==0) echo " 没找到任何备份文件... "; ?>
            </td>
        </tr>
        <tr class="artlist" height='24'>
            <?php if(is_array($filelists))  foreach($filelists as $k=>$v) { ?>
            <?php if($k%2==0 and $k>1){?></tr><tr class="artlist"><?php }?>
            <td width='10%'><input name='bakfile' id='bakfile' type='checkbox' class='np' value='<?php echo isset($v)?$v:"";?>' checked='1' /></td>
            <td width='40%'><?php echo isset($v)?$v:"";?></td>
            <?php if(count($filelists)%2!=0 and count($filelists)==($k+1)){?><td></td><td></td><?php }?>
            <?php }?>
        </tr>
        <tr align="center" bgcolor="#FDFDEA">
            <td height="24" colspan="4">
                &nbsp;
                <input name="b1" class="button" type="button" id="b1" onClick="SelAll()" value="全选" />
                &nbsp;
                <input name="b2" class="button" type="button" id="b2" onClick="ReSel()" value="反选" />
                &nbsp;
                <input name="b3" class="button" type="button" id="b3" onClick="NoneSel()" value="取消" />
            </td>
        </tr>
        <tr bgcolor="#F7F8ED">
            <td height="24" colspan="4" valign="top">
                <strong>附加参数：</strong>
            </td>
        </tr>
        <tr  bgcolor="#FFFFFF">
            <td height="24" colspan="4">
                <input name="structfile" type="checkbox" class="np" id="structfile" value="<?php echo isset($structfile)?$structfile:"";?>" checked='1' />
                还原表结构信息(<?php echo $structfile?>)
                <input name="delfile" type="checkbox" class="np" id="delfile" value="1" />
                还原后删除备份文件 </td>
        </tr>
        <tr bgcolor="#E3F4BB">
            <td></td>
            <td height="33" colspan="4">&nbsp; <input type="submit" class="button" name="Submit" value="开始还原数据" class="coolbg np" /></td>
        </tr>
    </form>


    <tr bgcolor="#F7F8ED">
        <td height="24" colspan="4"><strong>进行状态： </strong></td>
    </tr>
    <tr bgcolor="#FFFFFF">
        <td height="180" style="height:180px;" colspan="4">
            <iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe>
        </td>
    </tr>
</table>